<template>
  <div class="jiexiangchuishao-left-top">
    <div class="empty"></div>
    <div class="jxcs-title">
      <span class="title">吹哨总案件数</span>
      <span class="num pd-18">{{ total }}</span>
      <span class="unit">件</span>
    </div>
    <ul class="box-group">
      <li v-for="(item, index) in dataList" :key="index">
        <div class="box-group-left">
          <img :src="item.icon" alt="" />
        </div>
        <div class="box-group-right">
          <p style="padding-top: 10px">{{ item.label }}</p>
          <p :style="{ color: item.color }">
            <span class="group-num">{{ item.value }} </span>
            <span class="group-unit">件</span>
          </p>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
import { JieXiangChuiShaoDB } from '@/api'

export default {
  props: {
    // streetId: {
    //   type: String,
    //   default: ''
    // },
    // type: {
    //   type: String,
    //   default: '2'
    // },
    dataStatistics: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      total: 0,
      dataList: [
        {
          type: '1',
          label: '日常事件',
          value: 0,
          icon: require('../../../assets/images/jiexiangchuishao/cs01.png'),
          color: '#59d9ff'
        },
        {
          type: '2',
          label: '重要事项',
          value: 0,
          icon: require('../../../assets/images/jiexiangchuishao/cs02.png'),
          color: '#febb3b'
        },
        {
          type: '3',
          label: '重大事项',
          value: 0,
          icon: require('../../../assets/images/jiexiangchuishao/cs03.png'),
          color: '#fe3b72'
        },
        {
          type: '4',
          label: '其他事项',
          value: 0,
          icon: require('../../../assets/images/jiexiangchuishao/cs04.png'),
          color: '#56dd9c'
        }
      ],
      chuiShaoList: []
    }
  },
  watch: {
    dataStatistics(val) {
      this.total = 0
      this.dataList.forEach((item) => {
        val.forEach((element) => {
          if (item.type === element.type) {
            item.value = element.num
            this.total += element.num
          }
        })
      })
    }
  }
}
</script>

<style lang="less" scoped>
.fs-24 {
  font-size: 24px;
}
.fs-16 {
  font-size: 16px;
}
.pd-18 {
  padding-left: 18px;
}
.jiexiangchuishao-left-top {
  // width: 455px;
  margin: 0 auto;
  // margin-top: 30px;
  background: url(../../../assets/images/jiexiangchuishao/cs_bg01.png);
  background-size: 100% 100%;
  .empty {
    height: 22px;
  }
  .jxcs-title {
    width: 440px;
    margin: 0 auto;
    height: 45px;
    text-align: center;
    line-height: 45px;
    position: relative;
    ::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(90deg, #0b2a51 0%, #42d0fe 47%, #0c2549 100%);
      opacity: 0.3;
      z-index: -1;
      pointer-events: none; /* 禁止伪元素上的鼠标事件（如点击） */
    }
    .title {
      font-family: ShiShangZhongHeiJianTi;
      font-weight: 400;
      font-size: 22px;
      color: #ffffff;
      line-height: 45px;
      background: linear-gradient(0deg, #26ffed 0%, #20a8ff 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }
    .num {
      font-family: Noto Sans S Chinese;
      font-weight: bold;
      font-size: 24px;
      color: #bef0ff;
      line-height: 45px;
    }
    .unit {
      font-family: Noto Sans S Chinese;
      font-size: 16px;
      color: #bef0ff;
      line-height: 45px;
    }
  }
  .box-group {
    width: 440px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    padding: 20px 40px;
    li {
      width: 180px;
      height: 84px;
      // background: url(../../../assets/images/jiexiangchuishao/cs02.png);
      background-size: 100% 100%;
      // margin: 30px 0 0 30px;
      display: flex;
      .box-group-left {
        width: 65px;
        height: 65px;
        img {
          display: inline-block;
          width: 100%;
          height: 100%;
        }
      }

      .box-group-right {
        width: 80px;
        height: 65px;
        padding-left: 13px;
        p {
          font-family: SourceHanSansCNRegular;
          font-size: 16px;
          color: #ffffff;
          line-height: 23px;
          padding-top: 5 px;
          .group-num {
            font-family: NotoSansSChinese;
            font-size: 16px;
            line-height: 23px;
          }
          .group-unit {
            font-family: NotoSansSChinese;
            font-size: 16px;
            line-height: 23px;
          }
        }
      }
    }
  }
}
</style>
